package com.mcmaster.android.menus;

import java.io.FileNotFoundException;
import java.util.List;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;
//import com.google.zxing.integration.android.IntentIntegrator;
//import com.google.zxing.integration.android.IntentResult;
//import com.mcmaster.android.MapOverlay;
import com.mcmaster.android.Output;
import com.mcmaster.android.R;
import com.mcmaster.android.R.layout;
import android.app.Activity;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.mcmaster.android.control.Controller;
import com.mcmaster.android.control.FreeExploreControl;
import com.mcmaster.android.data.*;

public class FreeExploreMenu extends MapActivity
{
	String contents_;
	FreeExploreControl controller_;
    MapController mapctrl_;
    
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(layout.fexplore_layout_1);
		
		MapView mapView = (MapView) findViewById(R.id.mapview);
        mapView.setBuiltInZoomControls(true);
        mapView.setSatellite(true);
        
        controller_ = new FreeExploreControl(this, mapView);
		
		Button fe_start_btn = (Button)findViewById(R.id.button);
		Button scv_main_btn = (Button)findViewById(R.id.button2);
		
        scv_main_btn.setOnClickListener(new ButtonHandlerHomeMenu());
        fe_start_btn.setOnClickListener(new ButtonHandlerStart()); 
          
	}
	
	private class ButtonHandlerHomeMenu implements View.OnClickListener {
	    public void onClick(View v) {
	    	handleHomeClick();
	    }
	}
	
	private class ButtonHandlerStart implements View.OnClickListener {
	    public void onClick(View v) {
	    	handleStartClick();
	    }
	}
	
	private void handleHomeClick() {
		finish();
	}
	
	private void handleStartClick() {	
		controller_.startQRReader();
	}
	
	@Override
	protected boolean isRouteDisplayed() {
	    return false;
	}
}